How it's wired Tepna
← the -Dex suite · node wiring

🍬GlucoDex

GlucoDex senses one signal — continuous glucose — and computes the full glycemic suite. It is the suite’s metabolic receptor, and it can fuse an ECGDex export to read the autonomic↔glycemic link.

Signal sensed
Continuous glucose (CGM)~5-minute sampling, around the clock
Device
CGM sensorskin-patch continuous monitor
Input format
CGM CSVMDY date default · synthetic generator
Produces
Glycemic suite + fusion→ ganglior.node-export
01 — WHAT IT'S FOR

A single-signal receptor

Read the suite as a reflex arc: receptors → relay → integration → insight. GlucoDex is an afferent receptor — it does exactly one transduction well and reports inward. It never reaches into another node; cross-signal work happens only through the Ganglior export, consumed by the Integrator.

🧠
One signal per node. GlucoDex senses continuous glucose (cgm) and nothing else. If you’re tempted to sense a second signal, that’s a second node — fusion is the Integrator’s job, never a receptor’s.
02 — THE WIRING

The file stack

GlucoDex is built from external *.js files referenced by GlucoDex.src.html and bundled to a standalone GlucoDex.html. Dependencies point downhill only — UI → DSP → Core — and each file owns exactly one job. Edit the .js + .src.html, never the bundle; re-bundle after changes.

DSP
glucodex-dsp.jsDSP
Robust CSV ingest + the full glycemic math: core (mean/GMI/eA1c/SD/CV/TIR), variability (MAGE/CONGA/MODD/GVP/J-index/LBGI/HBGI), pattern detection (dawn/nocturnal hypo/excursions), AGP aggregation, and a synthetic CGM generator. Exposes window.GLUDSP.
glucodex-profile.jsDSP
Family profile tuned for CGM: Glycemic Stability hero, projected metabolic age, diabetes status / therapy / target override, and lab-A1c ground truth to validate GMI. Exposes window.GLUProfile.
Core
kernel-constants.jsCore · shared
The frozen physiology kernel — one source of truth for every cross-fleet threshold, plus a content-derived hash stamped into each export so two bundles built on different rulebooks can’t silently “agree” when fused.
ganglior-provenance.jsCore · shared
Loaded first — installs the read-hook that makes every export attributable to the exact code + inputs that produced it (the buildHash provenance stamp). 100% local.
metric-registry.jsCore · shared
The shared half of the evidence system: the badge SHAPE, depth tiering and the injected badge CSS. The per-node registry below supplies the DATA, so a Validated dot looks identical in every node.
glucodex-registry.jsCore
Per-metric DATA map; labels mirror the KPI grid + full metrics table. GlucoDex has no cross helper.
Render · UI
glucodex-render.jsRender · UI
GlucoScope canvas trace explorer (TIR bands, greyed warm-up/gap spans, pan/zoom + minimap) and hand-rolled SVG charts: AGP envelope, TIR stacked bar, daily overlay, distribution, the autonomic↔glycemic plot. Exposes window.GLUUI.
App · glue
glucodex-app.jsApp · glue
Glue + the FUSION engine: CGM ingest, pipeline, UI population, ingesting an ECGDex JSON into an autonomic-risk vector, the IR-risk band, and all exports.
🕒
The Clock Contract. GlucoDex stamps every record as floating wall-clock tMs (local civil time encoded as if UTC) and reads it back with getUTC* — so the recording reads identically in any viewer’s timezone, and two devices recording the same minute land on the same tMs. parseTimestamp is duplicated locally by design.
03 — HOW IT'S ACHIEVED

From file drop to Ganglior event

The pipeline is the same shape across the suite: ingest → parse on the canonical clock → compute in DSP → grade & render in UI → emit onto the bus. No number is computed in the render layer; it asks DSP for the value and the registry for how to show it.

Load CGM data

Drop a CGM CSV or generate a realistic synthetic trace. Ingest is robust to vendor column layouts.

glucodex-app.js → ingest

Parse on MDY clock

Timestamps become floating tMs; GlucoDex disambiguates dates as MDY (CGM convention) per the Clock Contract, never locale parsing.

parseTimestamp({preferDMY:false})

Compute on the full series

All glycemic math runs on the full cleaned series — decimation is render-only. Core metrics, variability suite, pattern detection and AGP percentiles.

glucodex-dsp.js (GLUDSP)

Optional fusion

If an ECGDex export is dropped, the autonomic-risk vector is combined with glycemic variability into an insulin-resistance-risk band and the autonomic↔glycemic plot.

glucodex-app.js → FUSION

Render + emit

GlucoScope and the AGP/TIR charts are drawn; events and metrics export onto Ganglior.

GLUUI + ganglior.node-export
04 — HOW MUCH TO TRUST IT

The evidence ladder

Every metric GlucoDex surfaces carries an evidence grade — a non-hue badge whose fill is the confidence ladder: solid bullseye for a raw reading, down to a dashed ring for a friendly estimate. A measurement and a projection must never look alike. Grades live in glucodex-registry.js, the one source of truth.

Measured Mean glucose · SD · MAG · % sensor active · active duration · nocturnal-hypo & excursion counts
Validated GMI · eA1c · CV · TIR / TITR / TBR / TAR · MAGE · MODD · CONGA · J-index · GRADE · ADRR · LBGI · HBGI
Emerging Dawn-phenomenon detection · AGP percentile patterns
Experimental Autonomic↔glycemic fusion · IR-risk band
Heuristic Projected metabolic age
05 — LIMITATIONS & CONSIDERATIONS

What it can and can't say

Honesty is architectural: a guess is never dressed as a measurement, a missing value stays null rather than fabricated, and confidence is kept separate from signal quality. The node-specific caveats:

Warm-up & gaps are greyednote

Sensor warm-up and dropout spans are excluded from the math and shown greyed on GlucoScope — they are not silently interpolated.

Compression lowscaution

Lying on the sensor can produce false nocturnal lows. Pattern detection flags them, but a confirmed hypo still needs a fingerstick.

GMI vs lab-A1cby design

The profile takes a real lab-A1c as ground truth and checks it against the sensor-derived GMI — the family’s device-vs-self honesty check.

Date format matterslimitation

CGM exports are MDY by convention; GlucoDex locks DMY/MDY deterministically per file so 05/13 and 13/05 both resolve to the same day.

06 — HOW TO USE IT

For the curious, and for the next coder

📂

Open the instrument

GlucoDex is one self-contained file. Open GlucoDex.html in any browser — online, offline, or from file://. Nothing installs, nothing phones home.

Open GlucoDex →
📥

Drop your recording

Drag a CGM sensor export (cgm csv) onto the upload zone. It’s read in-browser and turned into metrics on your device alone.

🎚️

Read at your depth

Start in Core for the headline readiness and a plain-language line. Step up to Advanced for full tables and charts, or Research for composites and the full dump. Each metric’s evidence dot tells you how far to trust it.

🔀

Export onto Ganglior

Export a ganglior.node-export JSON to feed the Integrator, or to upgrade a peer node’s read. Events carry a wall-clock t; consumers reconstruct absolute time from the recording start.

GlucoDex reference guide →
🛠️

If you’re changing it

Edit the glucodex-*.js files or GlucoDex.src.htmlnever the bundled GlucoDex.html — then re-bundle. Run Dex-Test-Suite.html until all-green, and verify-provenance.html after re-bundling.